<?php

class Application_Form_Editerquestions extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	
    	$Ordre = new Zend_Form_Element_Text('ordrequestion');
    	$Ordre->setLabel('Ordre: ')
    	->setRequired(true)
    	->addFilter('StripTags')
    	->addFilter('StringTrim')
    	->addValidator('NotEmpty');
    	
    	$Score = new Zend_Form_Element_Text('score');
    	$Score->setLabel('Nombre de reponse Juste: ')
    	->setRequired(true)
    	->addFilter('StripTags')
    	->addFilter('StringTrim')
    	->addValidator('NotEmpty');
    	 
    	
    	$mapper= new Application_Model_Mapper_Typequestion();
    	$select=$mapper->fetchAllToArray();
    	 
    	$tmp=array();
    	$tmp['']="selectionner un Type";
    	foreach ($select as $key => $value ){
    		$tmp[ $value['idtypequestion'] ] = $value['idtypequestion'];
    	}
    	$typequestion = array("multiOptions" => $tmp);
    	 
    	$typqst= new Zend_Form_Element_Select('typequestion_idtypequestion',  $typequestion);
    	$typqst->setLabel('Type de question ')	;
    	
    	
    	
    	
    	
    	$questiontext = new Zend_Form_Element_Textarea('textquestion');
    	$questiontext->setLabel('Question:')
    	->setRequired(true)
    	->setAttrib('COLS', '40')
    	->setAttrib('ROWS', '4');
    	
    	$description = new Zend_Form_Element_Textarea('description');
    	$description->setLabel('Description:')
    	->setRequired(true)
    	->setAttrib('COLS', '40')
    	->setAttrib('ROWS', '4');
    	
    	$submit = new Zend_Form_Element_Submit('submit',"Enregistrer");
    	
    	$this->addElements(array($Ordre,$questiontext,$typqst,$Score,$description,$submit));
    	$this->setDecorators( array( array('ViewScript', array('viewScript' => 'protypeform.phtml'))));
    	   
    	
    }


}

